'use strict';
const db = uniCloud.database();
exports.main = async (event, context) => {
	// 获取 `user` 集合的引用
	const collection = db.collection(event.colName);
	if(event.where){
		if(event.field){
			const res = await collection.where(event.where).field(event.field).orderBy('_id','asc').get() ;
			return res;
		}
		const res = await collection.where(event.where).orderBy('_id','asc').get() ;
		return res;
		
	}
	const res = await collection.orderBy('_id','asc').get() ;
	return res;
};
